package cn.edu.dlmu.cogo.register;

import cn.edu.dlmu.cogo.framework.config.JavaConfig;
import cn.hutool.core.date.DateUtil;

/**
 * @author hongda.li@hand-china.com 2022/3/10 21:15
 */
public class RegisterConfig extends JavaConfig {

    private String serviceName = "demo-service";

    /**
     * 心跳续约时间（TTL）默认为30秒
     */
    private int timeToLive = 30;

    /**
     * 缓冲时间默认为3秒
     */
    private int bufferTime = 3;

    private String hostname = "localhost";

    private String ip = "127.0.0.1";

    private int port = 8000;

    private String startTime = DateUtil.now();

    /**
     * 注册中心服务器的地址
     */
    private String registerServerUrl = "http://localhost:8000/";

    /**
     * 是否需要将自己注册到注册中心
     */
    private boolean selfRegister = true;

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public int getTimeToLive() {
        return timeToLive;
    }

    public void setTimeToLive(int timeToLive) {
        this.timeToLive = timeToLive;
    }

    public int getBufferTime() {
        return bufferTime;
    }

    public void setBufferTime(int bufferTime) {
        this.bufferTime = bufferTime;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getRegisterServerUrl() {
        return registerServerUrl;
    }

    public void setRegisterServerUrl(String registerServerUrl) {
        this.registerServerUrl = registerServerUrl;
    }

    public boolean isSelfRegister() {
        return selfRegister;
    }

    public void setSelfRegister(boolean selfRegister) {
        this.selfRegister = selfRegister;
    }

    public void setStartTime(String startTime){
        this.startTime = startTime;
    }

    public String getStartTime(){
        return this.startTime;
    }
}
